#pragma once
#include "DGeometry.h"

namespace Skill
{
	namespace Ode
	{
		ref class DMatrix4;
		ref class DVector3;
		ref class DSpace;

		namespace Geometries
		{			
			public ref class DBox : DGeometry
			{
			protected:
				virtual void CollectManagedMemory() override;
			public:
				///<summary>
				/// Create a box geom with the provided side lengths.
				///</summary>
				///<param name = "space">a space to contain the new geom. May be null.</param>
				///<param name = "lx"> the length of the box along the X axis </param>
				///<param name = "ly"> the length of the box along the Y axis</param>
				///<param name = "lz"> the length of the box along the Z axis</param>				
				///<remarks> The point of reference for a box is its center. </remarks>				
				DBox(DSpace^ space,dReal lx, dReal ly, dReal lz);


				///<summary>
				/// Create a box geom with the provided side lengths.
				///</summary>
				///<param name = "space">a space to contain the new geom. May be null.</param>
				///<param name = "l"> the length of the box along the axises </param>				
				///<remarks> The point of reference for a box is its center. </remarks>				
				DBox(DSpace^ space,DVector3^ l);

				///<summary>
				/// Gets or set the side lengths of the given box.
				///</summary>
				REF_PROP_DECLARATION_GETSET(DVector3,Lengths);

				///<summary>
				/// Return the depth of a point in a box.
				///</summary>
				///<param name = "x"> The X coordinate of the point to test.</param>
				///<param name = "y"> The Y coordinate of the point to test.</param>
				///<param name = "z"> The Z coordinate of the point to test.</param>				
				///<returns>
				/// The depth of the point. Points inside the box will have a 
				/// positive depth, points outside it will have a negative depth, and points
				/// on the surface will have a depth of zero.
				///</returns>

				dReal PointDepth(dReal x, dReal y, dReal z);
				///<summary>
				/// Return the depth of a point in a box.
				///</summary>
				///<param name = "p"> Coordinate of the point to test.</param>				
				///<returns>
				/// The depth of the point. Points inside the box will have a 
				/// positive depth, points outside it will have a negative depth, and points
				/// on the surface will have a depth of zero.
				///</returns>
				dReal PointDepth(DVector3^ p);
			};
		}
	}
}